<template>
  <div class="box">
<!--    头部-->
    <Head />
<!--    搜索-->
<div class="isSearch"> <van-search v-model="value"   shape="round" placeholder="请输入搜索关键词" />
  <div @click="tsxtSearch" class="tsxtSearch"><p>搜索</p></div>
</div>
    <van-dropdown-menu>
      <van-dropdown-item @click="clickval(ProjectList)"  v-model="value1" :options="option1" />
      <van-dropdown-item v-model="value2"  :options="option2" />
      <van-dropdown-item  v-model="value3" :options="option3" />
    </van-dropdown-menu>
    <div>

    </div>
  </div>
</template>

<script>
import Head from "@/views/login/components/Head";
import {getbuffer, getProjectList} from "@/api/login-api";
export default {
  name: "GoSearch",
  data(){
    return{
      ProjectList:[],
      Project:{},
      value: '',
        value1: 0,
        value2: 'a',
        value3: 'a',
        option1: [
          { text: '全部专题', value: "0" },
        ],
        option2: [
          { text: '全部类型', value: 'a' },
          { text: '免费课程', value: 'b' },
          { text: '付费课程', value: 'c' },
          { text: '精品课程', value: 'd' },
          { text: '限时折扣课程', value: 'e' },
        ],
      option3: [
         { text: '全部方式', value: 'a' },
         { text: '直播课程', value: 'b' },
         { text: '录播课程', value: 'c' },
      ],
      };
  },
  components: {
    Head,
  },
  created() {
      getProjectList().then(res=>{
        this.ProjectList=res.rows
        this.ProjectList.forEach(i =>{
         this.option1.push({text:i.title,value:i.subjectId})
        })
      })
    getProjectList().then(res=>{
      this.ProjectList=res.rows
      this.ProjectList.forEach(i =>{
        this.id = i.subjectId
        getbuffer(this.i.subjectId).then(res=>{
          console.log(res)
        })
      })
    })

  },
  methods: {
    tsxtSearch(){
      this.value
    },
    clickval(){

    }
  }
}
</script>

<style scoped lang="less">
.box{

  .isSearch{
    position: relative;
    display: flex;
    width: 100%;
    .tsxtSearch{
      background-color: #00cf8c;
      position: absolute;
      width: 16%;
      height: 61%;
      position: absolute;
      right: 2%;
      top: 10px;
      border-radius: 0 25% 25% 0;
      p{
        position: absolute;
        right: 25%;
        top: -11px;
      }
    }

  }
  .van-search{
    width: 100%;
  }
}
</style>